import { useEffect } from 'react'
import Layout from './Layout/'
import Demo from './components/Demo'

const App = () => {

  // 设置标题
  useEffect(() => {
    document.title = import.meta.env.VITE_APP_TITLE
  }, [])

  const renderContent = () => {
    if (import.meta.env.VITE_APP_IS_DEMO) {
      return <Demo />
    }
    return <Layout />
  }

  return <div className="App">
    {
      renderContent()
    }
  </div>
}

export default App